package com.egao.common.publicly;

import com.egao.common.core.web.JsonResult;
import com.egao.common.publicly.service.PubliclyLinkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 链接
 * @author pyx
 */
@Api(tags = "链接")
@RestController
@RequestMapping("${api}")
public class PubliclyLinkController {
    @Autowired
    private PubliclyLinkService publiclyLinkService;

    @ApiOperation("列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", value = "链接类型", required = false, dataType = "string", paramType = "query"),
    })
    @GetMapping("/publicly/link/list")
    public JsonResult list(String type){
            return JsonResult.ok().setData(publiclyLinkService.listType(type));
    }

}
